﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StudentManagerApplication.Model
{
    class Student
    {
        public Student()
        {

        }

        public Student(string _studentName, int _age)
        {
            Id = CurrentID++;
            StudentName = _studentName;
            Age = _age;
        }

        private int id;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        private string studentname;

        public string StudentName
        {
            get { return studentname; }
            set { studentname = value; }
        }

        private int age;

        public int Age
        {
            get { return age; }
            set { age = value; }
        }

        private Grade grade;

        public Grade Grade
        {
            get { return grade; }
            set { grade = value; }
        }

        private List<Subject> subjects = new List<Subject>();

        public List<Subject> Subjects
        {
            get { return subjects; }
            set { subjects = value; }
        }

        public static int CurrentID = 0;

        public float SumScore()
        {
            float sumScore = 0;
            foreach (Subject subject in subjects)
            {
                sumScore += subject.Score;
            }
            return sumScore;
        }
    }
}
